angular.module('app').controller('settingCtrl', 
['$scope', '$rootScope', 'http',
function($scope, $rootScope, http) 
{
	$scope.setting = {ptotal:0, plast:0, dtotal:0, dlast:0}

	$scope.ok = function(){
		var reqUrl = globalConfig.web + '/home/setting';
		http.post(reqUrl, $scope.setting, function(data, status){
			console.log(data)
		})
	}

	function ngInit(){
		var reqUrl = globalConfig.web + '/home/getting';
		http.get(reqUrl, function(data, status){
			if('null'!=data){
				$scope.setting = data;
			}
		})
	}

	ngInit()

	
}]);